package com.network.example;

import com.google.gson.Gson;
import com.network.MyHttpClient;
import com.network.bean.User;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by kkmike999 on 2016/06/04.
 */
public class Test {
	public static void main(String[] args) throws IOException {
		//		String url = "http://kkmike999-file.b0.upaiyun.com/user/kkmike999.json";

		MyHttpClient httpClient = new MyHttpClient();

		Map<String, Object> params = new HashMap<>();
		params.put("key", "value");

		String json = httpClient.get("user/kkmike999.json", params);

		User user = new Gson().fromJson(json, User.class);

		System.out.println(user);
	}
}
